import { defineStore } from "pinia";
import { ref } from "vue";

export const useModalStore = defineStore("modal", () => {
  // 登录弹窗显示状态
  const loginVisible = ref(false);
  // 注册弹窗显示状态
  const regVisible = ref(false);

  // 切换登录弹窗显示状态
  function switchLoginVisible() {
    loginVisible.value = !loginVisible.value;
  }

  // 切换注册弹窗显示状态
  function switchRegVisible() {
    regVisible.value = !regVisible.value;
  }

  return {loginVisible, regVisible, switchLoginVisible, switchRegVisible};
});
